#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int f_804870c(int *vb, int va)
{
 /*804870c:	55                   	push   %ebp
 804870d:	89 e5                	mov    %esp,%ebp
 804870f:	83 ec 10             	sub    $0x10,%esp
 8048712:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)*/
	int i;
// 8048719:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
	int j=0;

 /*8048720:	eb 18                	jmp    804873a <__libc_start_main@plt+0x38a>
 8048722:	8b 45 fc             	mov    -0x4(%ebp),%eax		// eax = j
 8048725:	8d 14 85 00 00 00 00 	lea    0x0(,%eax,4),%edx	// edx = (j+4)
 804872c:	8b 45 08             	mov    0x8(%ebp),%eax		// eax = vb
 804872f:	01 d0                	add    %edx,%eax		// eax = vb + (j+4)
 8048731:	8b 00                	mov    (%eax),%eax		// eax = vb[j]
 8048733:	01 45 f8             	add    %eax,-0x8(%ebp)		// i = i + vb[j]
 8048736:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)		// j++;
 804873a:	8b 45 fc             	mov    -0x4(%ebp),%eax		// eax = j
 804873d:	3b 45 0c             	cmp    0xc(%ebp),%eax	// *vb
 8048740:	7c e0                	jl     8048722 <__libc_start_main@plt+0x372>*/

	for (i = 0; i < va; i++) {
		j += vb[i];
	}
 
/*8048742:	8b 45 f8             	mov    -0x8(%ebp),%eax
 8048745:	c9                   	leave  
 8048746:	c3                   	ret*/
	return j;
}

int f_8048747(int (*vb)[4], int va)
{
/*8048747:	55                   	push   %ebp
 8048748:	89 e5                	mov    %esp,%ebp
 804874a:	83 ec 10             	sub    $0x10,%esp
 804874d:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)*/
	int i = 0;
 //8048754:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
	int j = 0;
	int k;

 /*804875b:	eb 2d                	jmp    804878a <__libc_start_main@plt+0x3da>
 804875d:	c7 45 f8 00 00 00 00 	movl   $0x0,-0x8(%ebp)	// k = 0;
 8048764:	eb 1a                	jmp    8048780 <__libc_start_main@plt+0x3d0>

 8048766:	8b 45 fc             	mov    -0x4(%ebp),%eax	// eax=j
 8048769:	c1 e0 04             	shl    $0x4,%eax	// eax = i << 4
 804876c:	89 c2                	mov    %eax,%edx	// edx = i << 4
 804876e:	8b 45 08             	mov    0x8(%ebp),%eax	// eax = vb
 8048771:	01 c2                	add    %eax,%edx	// edx = vb + i<<4
 8048773:	8b 45 f8             	mov    -0x8(%ebp),%eax	// eax = k
 8048776:	8b 04 82             	mov    (%edx,%eax,4),%eax	// eax = edx+k*4
 8048779:	01 45 f4             	add    %eax,-0xc(%ebp)	// j = j + eax
 804877c:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)	// k++
 8048780:	83 7d f8 03          	cmpl   $0x3,-0x8(%ebp)	
 8048784:	7e e0                	jle    8048766 <__libc_start_main@plt+0x3b6>

 8048786:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 804878a:	8b 45 fc             	mov    -0x4(%ebp),%eax
 804878d:	3b 45 0c             	cmp    0xc(%ebp),%eax
 8048790:	7c cb                	jl     804875d <__libc_start_main@plt+0x3ad>*/
	for (i = 0; i < va; i++) {
		for (k = 0; k < 4; k++) {
			j = vb[i][k];
		}
	}
	
/* 8048792:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8048795:	c9                   	leave  
 8048796:	c3                   	ret */   
	return j;
}

void f_804860d()
{
 //804860d:	55                   	push   %ebp
 //804860e:	89 e5                	mov    %esp,%ebp
 //8048610:	83 ec 78             	sub    $0x78,%esp
 //8048613:	c7 45 a4 0a 00 00 00 	movl   $0xa,-0x5c(%ebp)
 //804861a:	c7 45 a8 14 00 00 00 	movl   $0x14,-0x58(%ebp)
	int a[2] = {10, 20};

// 8048621:	8d 45 a4             	lea    -0x5c(%ebp),%eax
// 8048624:	89 45 f4             	mov    %eax,-0xc(%ebp)
	int *p = a;

/* 8048627:	c7 45 ac 01 00 00 00 	movl   $0x1,-0x54(%ebp)
 804862e:	c7 45 b0 02 00 00 00 	movl   $0x2,-0x50(%ebp)
 8048635:	c7 45 b4 03 00 00 00 	movl   $0x3,-0x4c(%ebp)
 804863c:	c7 45 b8 f7 ff ff ff 	movl   $0xfffffff7,-0x48(%ebp)
 8048643:	c7 45 bc 04 00 00 00 	movl   $0x4,-0x44(%ebp)
 804864a:	c7 45 c0 05 00 00 00 	movl   $0x5,-0x40(%ebp)
 8048651:	c7 45 c4 06 00 00 00 	movl   $0x6,-0x3c(%ebp)
 8048658:	c7 45 c8 f8 ff ff ff 	movl   $0xfffffff8,-0x38(%ebp)*/
	int b[2][4] = {{1, 2, 3, -9}, {4, 5, 6, -8}};

// 804865f:	8d 45 ac             	lea    -0x54(%ebp),%eax
// 8048662:	89 45 f0             	mov    %eax,-0x10(%ebp)
	int (*p2)[4] = b;	// 根据 f_8048747 函数汇编代码反向推出，有shl指令

 /*8048665:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
 804866c:	00 
 804866d:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8048670:	89 04 24             	mov    %eax,(%esp)
 8048673:	e8 94 00 00 00       	call   804870c <__libc_start_main@plt+0x35c>
 8048678:	89 45 ec             	mov    %eax,-0x14(%ebp) */
	int var1 = f_804870c(p, 0x2);

 /*804867b:	c7 44 24 04 02 00 00 	movl   $0x2,0x4(%esp)
 8048682:	00 
 8048683:	8b 45 f0             	mov    -0x10(%ebp),%eax
 8048686:	89 04 24             	mov    %eax,(%esp)
 8048689:	e8 b9 00 00 00       	call   8048747 <__libc_start_main@plt+0x397>
 804868e:	89 45 e8             	mov    %eax,-0x18(%ebp)*/
	int var2 = f_8048747(p2, 0x2);

 /*8048691:	c7 45 cc 04 00 00 00 	movl   $0x4,-0x34(%ebp)
 8048698:	c7 45 d0 04 00 00 00 	movl   $0x4,-0x30(%ebp)
 804869f:	c7 45 d4 04 00 00 00 	movl   $0x4,-0x2c(%ebp)
 80486a6:	c7 45 d8 05 00 00 00 	movl   $0x5,-0x28(%ebp)
 80486ad:	c7 45 dc 05 00 00 00 	movl   $0x5,-0x24(%ebp)
 80486b4:	c7 45 e0 05 00 00 00 	movl   $0x5,-0x20(%ebp)*/
	int c[6] = {4, 4, 4, 5, 5, 5};

 /*80486bb:	c7 44 24 04 06 00 00 	movl   $0x6,0x4(%esp)
 80486c2:	00 
 80486c3:	8d 45 cc             	lea    -0x34(%ebp),%eax
 80486c6:	89 04 24             	mov    %eax,(%esp)
 80486c9:	e8 3e 00 00 00       	call   804870c <__libc_start_main@plt+0x35c>
 80486ce:	89 45 e4             	mov    %eax,-0x1c(%ebp)*/
	int var3 = f_804870c(c, 6);

 /*80486d1:	8b 45 ec             	mov    -0x14(%ebp),%eax
 80486d4:	89 44 24 04          	mov    %eax,0x4(%esp)
 80486d8:	c7 04 24 44 8b 04 08 	movl   $0x8048b44,(%esp)
 80486df:	e8 ac fc ff ff       	call   8048390 <printf@plt>*/
	printf("asdfasdf %d\n", var1);

 /*80486e4:	8b 45 e8             	mov    -0x18(%ebp),%eax
 80486e7:	89 44 24 04          	mov    %eax,0x4(%esp)
 80486eb:	c7 04 24 51 8b 04 08 	movl   $0x8048b51,(%esp)
 80486f2:	e8 99 fc ff ff       	call   8048390 <printf@plt>*/
	printf("asdfasdf %d\n", var2);

 /*80486f7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 80486fa:	89 44 24 04          	mov    %eax,0x4(%esp)
 80486fe:	c7 04 24 5e 8b 04 08 	movl   $0x8048b5e,(%esp)
 8048705:	e8 86 fc ff ff       	call   8048390 <printf@plt>*/
	printf("asdfasdf %d\n", var3); 
}

void f_8048797()
{
}

void f_80484d0(){}

void f_8048593(){}
void f_804859b(){}
void f_80485cd(){}
void f_8048855()
{
 /*8048855:	55                   	push   %ebp
 8048856:	89 e5                	mov    %esp,%ebp
 8048858:	83 ec 38             	sub    $0x38,%esp*/
 /*804885b:	c7 45 e4 01 00 00 00 	movl   $0x1,-0x1c(%ebp)
 8048862:	c7 45 e8 02 00 00 00 	movl   $0x2,-0x18(%ebp)
 8048869:	c7 45 ec 03 00 00 00 	movl   $0x3,-0x14(%ebp)
 8048870:	c7 45 f0 04 00 00 00 	movl   $0x4,-0x10(%ebp)
 8048877:	c7 45 f4 09 00 00 00 	movl   $0x9,-0xc(%ebp)*/
	int a[5] = {1, 2, 3, 4, 9};

 /*804887e:	8d 45 e4             	lea    -0x1c(%ebp),%eax	// eax = a
 8048881:	83 c0 14             	add    $0x14,%eax		// eax = eax+0x14
 8048884:	89 45 e0             	mov    %eax,-0x20(%ebp)	*/
	int *p1 = &a + 1;

 /*8048887:	8d 45 e4             	lea    -0x1c(%ebp),%eax	// eax = a
 804888a:	83 c0 01             	add    $0x1,%eax		// eax = &a+1
 804888d:	89 45 dc             	mov    %eax,-0x24(%ebp) */
	int *p2 = (int)a + 1;

 /*8048890:	8d 45 e4             	lea    -0x1c(%ebp),%eax		// eax = a
 8048893:	83 c0 14             	add    $0x14,%eax			// eax = a + 0x14
 8048896:	89 45 d8             	mov    %eax,-0x28(%ebp) */
	int *p3 = a + 5;

 /*8048899:	8d 45 e4             	lea    -0x1c(%ebp),%eax	// eax = a
 804889c:	89 44 24 04          	mov    %eax,0x4(%esp)	
 80488a0:	c7 04 24 6b 8b 04 08 	movl   $0x8048b6b,(%esp)
 80488a7:	e8 e4 fa ff ff       	call   8048390 <printf@plt> */
	printf("a = %p\n", a);

 /*80488ac:	8d 45 e4             	lea    -0x1c(%ebp),%eax
 80488af:	89 44 24 04          	mov    %eax,0x4(%esp)
 80488b3:	c7 04 24 75 8b 04 08 	movl   $0x8048b75,(%esp)
 80488ba:	e8 d1 fa ff ff       	call   8048390 <printf@plt> */
	printf("a = %p\n", &a);

 /*80488bf:	8d 45 e4             	lea    -0x1c(%ebp),%eax
 80488c2:	83 c0 04             	add    $0x4,%eax
 80488c5:	89 44 24 04          	mov    %eax,0x4(%esp)
 80488c9:	c7 04 24 6b 8b 04 08 	movl   $0x8048b6b,(%esp)
 80488d0:	e8 bb fa ff ff       	call   8048390 <printf@plt> */
	printf("a = %p\n", a+1);

 /*80488d5:	8d 45 e4             	lea    -0x1c(%ebp),%eax
 80488d8:	83 c0 14             	add    $0x14,%eax
 80488db:	89 44 24 04          	mov    %eax,0x4(%esp)
 80488df:	c7 04 24 75 8b 04 08 	movl   $0x8048b75,(%esp)
 80488e6:	e8 a5 fa ff ff       	call   8048390 <printf@plt> */
	printf("a = %p\n", a+5);

 /*80488eb:	8b 45 d8             	mov    -0x28(%ebp),%eax
 80488ee:	89 44 24 04          	mov    %eax,0x4(%esp)
 80488f2:	c7 04 24 7f 8b 04 08 	movl   $0x8048b7f,(%esp)
 80488f9:	e8 92 fa ff ff       	call   8048390 <printf@plt> */
	printf("p3 = %x\n", p3);

 /*80488fe:	8b 45 d8             	mov    -0x28(%ebp),%eax
 8048901:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048905:	c7 04 24 8c 8b 04 08 	movl   $0x8048b8c,(%esp)
 804890c:	e8 7f fa ff ff       	call   8048390 <printf@plt> */
	printf("p3 = %p\n", p3);

 /*8048911:	8d 45 d8             	lea    -0x28(%ebp),%eax
 8048914:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048918:	c7 04 24 97 8b 04 08 	movl   $0x8048b97,(%esp)
 804891f:	e8 6c fa ff ff       	call   8048390 <printf@plt> */
	printf("p3 = %p\n", &p3);

 /*8048924:	8b 45 e0             	mov    -0x20(%ebp),%eax
 8048927:	8b 00                	mov    (%eax),%eax
 8048929:	89 44 24 04          	mov    %eax,0x4(%esp)
 804892d:	c7 04 24 a3 8b 04 08 	movl   $0x8048ba3,(%esp)
 8048934:	e8 57 fa ff ff       	call   8048390 <printf@plt> */
	printf("p1 = %x\n", *p1);

 /*8048939:	8b 45 e0             	mov    -0x20(%ebp),%eax
 804893c:	8b 00                	mov    (%eax),%eax
 804893e:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048942:	c7 04 24 b2 8b 04 08 	movl   $0x8048bb2,(%esp)
 8048949:	e8 42 fa ff ff       	call   8048390 <printf@plt> */
	printf("p1 = %p\n", *p1);

 /*804894e:	8b 45 e0             	mov    -0x20(%ebp),%eax
 8048951:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048955:	c7 04 24 bd 8b 04 08 	movl   $0x8048bbd,(%esp)
 804895c:	e8 2f fa ff ff       	call   8048390 <printf@plt> */
	printf("p1 = %x\n", p1);

 /*8048961:	8b 45 e0             	mov    -0x20(%ebp),%eax
 8048964:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048968:	c7 04 24 b2 8b 04 08 	movl   $0x8048bb2,(%esp)
 804896f:	e8 1c fa ff ff       	call   8048390 <printf@plt> */
	printf("p1 = %p\n", p1);

 /*8048974:	8d 45 e0             	lea    -0x20(%ebp),%eax
 8048977:	89 44 24 04          	mov    %eax,0x4(%esp)
 804897b:	c7 04 24 ca 8b 04 08 	movl   $0x8048bca,(%esp)
 8048982:	e8 09 fa ff ff       	call   8048390 <printf@plt> */
	printf("p1 = %p\n", &p1);

 /*8048987:	8b 45 e0             	mov    -0x20(%ebp),%eax 	// eax = p1;
 804898a:	83 e8 04             	sub    $0x4,%eax			// eax = p1 - 1
 804898d:	8b 00                	mov    (%eax),%eax		// 
 804898f:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048993:	c7 04 24 d6 8b 04 08 	movl   $0x8048bd6,(%esp)
 804899a:	e8 f1 f9 ff ff       	call   8048390 <printf@plt> */
	printf("p1 = %d\n", *(p1-1));

 /*804899f:	8b 45 dc             	mov    -0x24(%ebp),%eax
 80489a2:	89 44 24 04          	mov    %eax,0x4(%esp)
 80489a6:	c7 04 24 e5 8b 04 08 	movl   $0x8048be5,(%esp)
 80489ad:	e8 de f9 ff ff       	call   8048390 <printf@plt> */
	printf("p2 = %p\n", p2);

 /*80489b2:	8d 45 dc             	lea    -0x24(%ebp),%eax
 80489b5:	89 44 24 04          	mov    %eax,0x4(%esp)
 80489b9:	c7 04 24 f0 8b 04 08 	movl   $0x8048bf0,(%esp)
 80489c0:	e8 cb f9 ff ff       	call   8048390 <printf@plt> */
	printf("p2 = %p\n", &p2);

 /*80489c5:	b8 00 00 00 00       	mov    $0x0,%eax
 80489ca:	c9                   	leave  
 80489cb:	c3                   	ret  */  
	return 0;
}

void f_80489cc()
{
 /*80489cc:	55                   	push   %ebp
 80489cd:	89 e5                	mov    %esp,%ebp
 80489cf:	57                   	push   %edi
 80489d0:	53                   	push   %ebx
 80489d1:	83 ec 40             	sub    $0x40,%esp */
 /*80489d4:	8d 5d cc             	lea    -0x34(%ebp),%ebx
 80489d7:	b8 00 00 00 00       	mov    $0x0,%eax
 80489dc:	ba 0a 00 00 00       	mov    $0xa,%edx
 80489e1:	89 df                	mov    %ebx,%edi
 80489e3:	89 d1                	mov    %edx,%ecx
 80489e5:	f3 ab                	rep stos %eax,%es:(%edi)*/
	int a[10] = {0};

 /*80489e7:	c7 45 cc 0b 00 00 00 	movl   $0xb,-0x34(%ebp)
 80489ee:	c7 45 d0 0f 00 00 00 	movl   $0xf,-0x30(%ebp)
 80489f5:	c7 45 d4 14 00 00 00 	movl   $0x14,-0x2c(%ebp)
 80489fc:	c7 45 d8 19 00 00 00 	movl   $0x19,-0x28(%ebp)
 8048a03:	c7 45 dc 1e 00 00 00 	movl   $0x1e,-0x24(%ebp)*/
	a[0] = 0xb;
	a[1] = 0xf;
	a[2] = 0x14;
	a[3] = 0x19;
	a[4] = 0x1e;
 /*8048a0a:	8d 45 cc             	lea    -0x34(%ebp),%eax
 8048a0d:	83 c0 08             	add    $0x8,%eax
 8048a10:	89 45 f4             	mov    %eax,-0xc(%ebp)*/
	int *p1 = a + 2;

 /*8048a13:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8048a16:	8b 00                	mov    (%eax),%eax
 8048a18:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048a1c:	c7 04 24 fc 8b 04 08 	movl   $0x8048bfc,(%esp)
 8048a23:	e8 68 f9 ff ff       	call   8048390 <printf@plt>*/
	printf(" %d\n", *p1);

 /*8048a28:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8048a2b:	83 e8 04             	sub    $0x4,%eax
 8048a2e:	8b 00                	mov    (%eax),%eax
 8048a30:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048a34:	c7 04 24 fc 8b 04 08 	movl   $0x8048bfc,(%esp)
 8048a3b:	e8 50 f9 ff ff       	call   8048390 <printf@plt>*/
	printf(" %d\n", *(p1-1));

 /*8048a40:	8b 45 f4             	mov    -0xc(%ebp),%eax
 8048a43:	83 e8 08             	sub    $0x8,%eax
 8048a46:	8b 00                	mov    (%eax),%eax
 8048a48:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048a4c:	c7 04 24 fc 8b 04 08 	movl   $0x8048bfc,(%esp)
 8048a53:	e8 38 f9 ff ff       	call   8048390 <printf@plt>*/
	printf(" %d\n", p1[-2]);

 /*8048a58:	8b 45 f0             	mov    -0x10(%ebp),%eax
 8048a5b:	89 44 24 04          	mov    %eax,0x4(%esp)
 8048a5f:	c7 04 24 fc 8b 04 08 	movl   $0x8048bfc,(%esp)
 8048a66:	e8 25 f9 ff ff       	call   8048390 <printf@plt>*/
	printf(" %d\n", a[9]);

 /*8048a6b:	b8 00 00 00 00       	mov    $0x0,%eax
 8048a70:	83 c4 40             	add    $0x40,%esp
 8048a73:	5b                   	pop    %ebx
 8048a74:	5f                   	pop    %edi
 8048a75:	5d                   	pop    %ebp
 8048a76:	c3                   	ret*/
}

int main()
{
	f_804860d();
	f_8048797();
	f_80484d0();
	f_8048593();
	f_804859b();
	f_80485cd();
	f_8048855();
	f_80489cc();

	return 0;
}
